<%--
  Created by IntelliJ IDEA.
  User: Nikita.Brazhnikov
  Date: 10/16/12
  Time: 10:57 AM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
    <title>Numbers</title>
    <link rel="stylesheet" href="resources/style.css"/>
</head>
<body>
<form action="numbers" method="get">
    <div class="formclass">
    <input type="text" name="number"/>
    <input type="submit" name="translate" value="Translate it now"/>
    </div>
    <p/>
    <c:choose>
        <c:when test="${not empty requestScope['error']}">
            <h3 style="color: red;">${requestScope.error}</h3>
        </c:when>
        <c:otherwise>
            <c:if test="${not empty requestScope['translation']}">
                <h3>${param['number']} = ${requestScope['translation']}</h3>
            </c:if>
        </c:otherwise>
    </c:choose>
</form>
</body>
</html>